import request from "@/utils/request";
import { AesMain } from "@/utils/AesHmacMD5"

// 校验模板编码的唯一性
export function unique(query) {
  return request({
    url: "/admin/budget/form/unique/",
    method: "post",
    data: AesMain(query)
  });
}


// excel 录入保存信息
export function addEnter(enterForm) {
  return request({
    url: "/admin/budget/enter/addEnter/",
    method: "post",
    data: AesMain(enterForm)
  });
}

// excel 查看录入信息
export function enterListType(enterForm) {
  return request({
    url: "/admin/budget/enter/enterListType/",
    method: "post",
    data: AesMain(enterForm)
  });
}

// excel 录取-------------下载
export function downloadEnterdata(enterForm) {
  return request({
    url: "/admin/budget/enter/downloadEnterdata/",
    method: "post",
    data: AesMain(enterForm)
  });
}
// 删除enter列表
export function delEnterType(query) {
  return request({
    url: "/admin/budget/enter/delEnterType/",
    method: "post",
    data: AesMain(query)
  });
}

// 删除模板列表
export function treeByFormId(formId) {
  return request({
    url: "/admin/budget/form/treeByFormId/" + formId + "/",
    method: "get"
  });
}

// ================================================================================
// ================================================================================
// ================================================================================

// 查询区域列表
export function listRegionType(query) {
  return request({
    url: "/admin/budget/region/list/",
    method: "post",
    data: AesMain(query)
  });
}

// 查询区域列表
export function listRegionType0(query) {
  return request({
    url: "/admin/budget/region0/list/",
    method: "post",
    data: AesMain(query)
  });
}
// 查询钻机列表
export function listRigType(query) {
  return request({
    url: "/admin/budget/rig/list/",
    method: "post",
    data: AesMain(query)
  });
}
// 查询公司列表
export function listCompanyType(query) {
  return request({
    url: "/admin/budget/company/list/",
    method: "post",
    data: AesMain(query)
  });
}

// 校验模板表头数据是否重复---针对于整个表头数据
export function inspectHeaderAll(query) {
  return request({
    url: "/admin/budget/form/inspectHeaderAll/",
    method: "post",
    data: AesMain(query)
  });
}

// 新增一级区域
export function addRegionType0(query) {
  return request({
    url: "/admin/budget/region/add/",
    method: "post",
    data: AesMain(query)
  });
}

// 新增二级区域
export function addRegionType1(query) {
  return request({
    url: "/admin/budget/region1/add/",
    method: "post",
    data: AesMain(query)
  });
}
// 新增钻机
export function addRigType(query) {
  return request({
    url: "/admin/budget/rig/add/",
    method: "post",
    data: AesMain(query)
  });
}
// 新增公司
export function addCompanyType(query) {
  return request({
    url: "/admin/budget/company/add/",
    method: "post",
    data: AesMain(query)
  });
}

// 根据ID回显模板数据
export function dataEche(query) {
  return request({
    url: "/admin/budget/form/dataEche/",
    method: "post",
    data: AesMain(query)
  });
}

// 修改模板列表
export function editType(query) {
  return request({
    url: "/admin/budget/form/edit/",
    method: "post",
    data: AesMain(query)
  });
}

export function editRegionType0(query) {
  return request({
    url: "/admin/budget/region0/edit/",
    method: "post",
    data: AesMain(query)
  });
}

export function editRegionType1(query) {
  return request({
    url: "/admin/budget/region1/edit/",
    method: "post",
    data: AesMain(query)
  });
}
//修改钻机信息
export function editRigType(query) {
  return request({
    url: "/admin/budget/rig/edit/",
    method: "post",
    data: AesMain(query)
  });
}

//修改公司信息
export function editCompanyType(query) {
  return request({
    url: "/admin/budget/company/edit/",
    method: "post",
    data: AesMain(query)
  });
}

// 删除钻机
export function delRigType(query) {
  return request({
    url: "/admin/budget/rig/delete/",
    method: "post",
    data: AesMain(query) 
  });
}

// 删除公司
export function delCompanyType(query) {
  return request({
    url: "/admin/budget/company/delete/",
    method: "post",
    data: AesMain(query) 
  });
}

// 删除一级区域
export function delRegion0Type(query) {
  return request({
    url: "/admin/budget/region0/delete/",
    method: "post",
    data: AesMain(query) 
  });
}
// 删除二级区域
export function delRegion1Type(query) {
  return request({
    url: "/admin/budget/region1/delete/",
    method: "post",
    data: AesMain(query) 
  });
}
// 模板转字典类型
export function modelToDict() {
  return request({
    url: "/admin/budget/form/modelToDict/",
    method: "post",
    data: AesMain()
  });
}